﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core
{
    public class LopHoc : BaseData, IInestor
    {
        public String MaLop { get; set; }
        public String TenLop { get; set; }
        public int SiSo { get; set; }
        public int MaKhoa { get; set; }

        public string TenKhoa
        {
            get
            {
                Khoa vid = (Khoa)QLDSKhoa.Instance.Find(x => (x as Khoa).MaKhoa ==MaKhoa );
                    if(vid!=null)
                return vid.TenKhoa;
                else return "";
                
            }
        }



        public void Update(QuanLiSinhVien sv)
        {
            SiSo = sv.data.FindAll(c => (c as SinhVien).MaLop == MaLop).Count;
        }
        public override string ToString()
        {
            StringBuilder temp = new StringBuilder();
            temp.AppendFormat("{0}\t{1}\t{2}\t{3}", MaLop, TenLop, SiSo, MaKhoa);
            return temp.ToString();
        }


    }
}
